<?php
class Application_Model_Team extends App_DbTable
{
	
	public function __construct($id = null){
		parent::__construct(new Application_Model_DbTable_Team(), $id);
	}
	public function getAll($pagination = false, $currPage = 1, $checkVisible = true){
		$select = $this->_dbTable->select();
		if($checkVisible){
			$select->where('visible = ?', 1);
		}
		
		if($pagination){
	       	$paginator = Zend_Paginator::factory($select);
			$paginator->setItemCountPerPage(10);
	        $paginator->setPageRange(3);
	       	$paginator->setCurrentPageNumber($currPage);         
			return $paginator;
		}
		else{
			return $this->_dbTable->fetchAll($select);
		}
	}
}